﻿using System;
using System.Collections.Generic;
using System.Text;

namespace csharpcore7_ch3
{
    public class BaseClass
    {
        public int X;
        public BaseClass() { }
        public BaseClass(int x) { this.X = x; }
    }
    public class Subclass : BaseClass
    {
        //子类必须重新定义它希望对外公开的任何构造器。不过，它可以使用base关键字调用基类的任何一个构造器
        public Subclass(int x) : base(x) { }
    }
    class Chapt3_2_8_ConstructorAndInheritance
    {
        static void _Main()
        {
            Subclass s = new Subclass(3);
        }
    }
}
